define([], function() {
    var tpl = {};

    tpl.info = function() {
        return info();
    }
    tpl.getPlanDetail = function() {
        return getPlanDetail();
    }
    tpl.modifyStageName = function() {
        return modifyStageName();
    }
    tpl.addClassify = function() {
        return addClassify();
    }
    tpl.queryAllScheme = function() {
        return queryAllScheme();
    }
    tpl.queryAllCourse = function() {
        return queryAllCourse();
    }
    tpl.addStage = function() {
        return addStage();
    }

    tpl.allScheme = function() {
        return allScheme();
    }
    tpl.allCourse = function() {
        return allCourse();
    }

    /* 基本信息 */
    var info = function() {
        return  '<script id="tpl_treatPlan_info" type="text/html">' +
                '    <span>门诊号：{{hisNo}}</span>'+
                '    <span>姓名：{{userName}}</span>'+
                '    <span>{{schemeName}}</span>'+
                '    <span>分组：{{if groupValue=="00"}}不随机{{else if groupValue=="01"}}随机A{{else if groupValue=="02"}}随机B{{else if groupValue=="03"}}随机D{{else if groupValue=="04"}}随机I{{/if}}</span>'+
                '</script>';
    }
    /* 获取计划详情 */
    var getPlanDetail = function() {
        return  '<script id="tpl_treatPlan_getPlanDetail" type="text/html">' +
                '   <div class="stage-title clearfix">' +
                '       <div class="stage-title-stage">阶段</div>' +
                '       <div class="stage-title-beginTime">疗程开始时间</div>' +
                '       <div class="stage-title-course">疗程</div>' +
                '   </div>' +
                '   <div class="stageList" id="stage">' +
                '       {{if list.length > 0}}' +
                '           {{each list as value i}}' +
                '               <div class="stage-div" data-ptStageId="{{value.ptStageId}}">' +
                '                   <div class="stage-name">{{value.stageName}}</div>' +
                '                   <div class="stage-course-list connectedSortable">' +
                '                       {{if value.ptDisCoursePOs.length > 0}}' +
                '                           {{each value.ptDisCoursePOs as val j}}' +
                '                               <div class="stage-course clearfix" id="{{val.courseId}}" data-ptCourseId="{{val.ptCourseId}}" data-seqNo="{{j+1}}" data-version="{{val.courseVersion}}" data-status="{{val.status}}">' +
                '                                   <div class="stage-course-beginTime">{{val.startDate}}</div>' +
                '                                   <div class="stage-course-name">{{val.courseName}}</div>' +
                '                               </div>' +
                '                           {{/each}}' +
                '                       {{else}}' +
                '                           <div class="stage-null" draggable="false">还没有疗程，请添加</div>' +
                '                       {{/if}}' +
                '                   </div>' +
                '               </div>' +
                '           {{/each}}' +
                '       {{/if}}' +
                '   </div>' +
                '</script>';
    }
    /*修改阶段名称模态框 */
    var modifyStageName = function() {
        return  '<script id="tpl_treatPlan_modifyStageName" type="text/html">' +
                '   <div class="treatPlan-modal">' +
                '       <div class="input-group">' +
                '           <input id="ptStageName" type="text" class="form-control" value="{{stageName}}">' +
                '       </div>' +
                '       <div id="modify" class="confirmBtn">确定</div>' +
                '   </div>' +
                '</script>';
    }
    /*插入方案模态框 */
    var addClassify = function() {
        return '<script id="tpl_treatPlan_addClassify" type="text/html">' +
            '   <div class="treatPlan-modal">' +
            '       <div class="input-group">' +
            '           <label class="control-label">方案库</label>' +
            '           <select id="schemeId" class="form-control input">' +

            '           </select>' +
            '       </div>' +
            '       <div class="input-inline">' +
            '           <div class="input-group">' +
            '               <label class="control-label">起始阶段</label>' +
            '               <select id="startStageSeqNo" class="form-control input">' +

            '               </select>' +
            '           </div>' +
            '           <div class="input-group">' +
            '               <label class="control-label">起始疗程</label>' +
            '               <select id="startCourseSeqNo" class="form-control input">' +

            '               </select>' +
            '           </div>' +
            '       </div>' +
            '       <div class="input-inline">' +
            '           <div class="input-group">' +
            '               <label class="control-label">结束阶段</label>' +
            '               <select id="endStageSeqNo" class="form-control input">' +

            '               </select>' +
            '           </div>' +
            '           <div class="input-group">' +
            '               <label class="control-label">结束疗程</label>' +
            '               <select id="endCourseSeqNo" class="form-control input">' +

            '               </select>' +
            '           </div>' +
            '       </div>' +
            '       <div id="add" class="confirmBtn">添加</div>' +
            '   </div>' +
            '</script>';
    }
    /*方案分类 */
    var queryAllScheme = function() {
        return  '<script id="tpl_treatPlan_queryAllScheme" type="text/html">' +
                '   <option value="">全部</option>' +
                '   {{each list as value i}}' +
                '       <option value="{{value.id}}">{{value.class_name}}</option>' +
                '   {{/each}}' +
                '</script>';
    }
    /*查询所有疗程 */
    var queryAllCourse = function() {
        return  '<script id="tpl_treatPlan_queryAllCourse" type="text/html">' +
                '   {{if list.length>0}}' +
                '       {{each list as value i}}' +
                '           <div class="courseStore_item" id="{{value.id}}" data-version="{{value.course_version}}" data-index="{{i+1}}">' +
                '               {{value.course_name}}' +
                '           </div>' +
                '       {{/each}}' +
                '   {{/if}}' +
                '</script>';
    }
    /*添加阶段模态框 */
    var addStage = function() {
        return  '<script id="tpl_treatPlan_addStage" type="text/html">' +
                '	<div class="treatPlan-modal">' +
                '	    <div class="input-group">' +
                '	        <input id="ptStageName" type="text" class="form-control">' +
                '	    </div>' +
                '		<div id="add" class="confirmBtn">确定</div>' +
                '   </div>' +
                '</script>';
    }
    /*模态框方案分类 */
    var allScheme = function() {
        return  '<script id="tpl_treatPlan_allScheme" type="text/html">' +
                '   {{each list as value i}}' +
                '       <option value="{{value.id}}">{{value.class_name}}</option>' +
                '   {{/each}}' +
                '</script>';
    }
    /*模态框疗程 */
    var allCourse = function() {
        return  '<script id="tpl_treatPlan_allCourse" type="text/html">' +
                '   {{each list as value i}}' +
                '       <option value="{{value.id}}" data-index="{{i+1}}">{{value.course_name}}</option>' +
                '   {{/each}}' +
                '</script>';
    }

    return tpl;
});